<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Guaripolo Store</title>
<meta name="description" content="My Store" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/960.css" media="all" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/color.css" media="screen" />

<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="stylesheet/ie.css" media="screen" />
<![endif]-->
<!-- meta facebook -->
	        <meta property="og:type"  content="article" />
	        <meta property="fb:admins" content="781201601" />
<div id="fb-root"></div>

<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/shoppica.js"></script>
<?php $result=$this->usuario->getCarro()->getAllProductos();
$ids='';
$precs='';
$cants='';
foreach($result->result_array() as $producto)
{
	$ids=$ids."".$producto['idProductos'].";";
	$precs=$precs."".$producto['Precio'].";";
	$cants=$cants."".$producto['cantidad'].";";
}
?>


</head>



<body class="s_layout_fixed">


<div id="wrapper"> 

  

  <!-- ********************** --> 

  <!--      H E A D E R       --> 

  <!-- ********************** -->

  
  <div id="header" class="container_12">
    <div class="grid_12">
    
    	<a id="site_logo" href="index.html">Guaripolo Store</a> 

     <div id="system_navigation" class="s_nav">
        <ul class="s_list_1 clearfix">
          <li><a href="<?php echo base_url()."catalogo"?>">Inicio</a></li>
          <li><a href="<?php echo base_url()."home/logout"?>">Log Out</a></li>
          <li><a href="<?php echo base_url()."carrito"?>">Carro de compras</a></li>
          <li><a href="<?php echo base_url()."historial"?>">Historial</a></li>
          
        </ul>
      </div>

      <div id="site_search">
      	<a id="show_search" href="javascript:;" title="Search:"></a>
        <div id="search_bar" class="clearfix">
          <input type="text" id="filter_keyword" />
          <select id="filter_category_id">
            <option value="0">Todas las categorias</option>
            <option value="1">PC</option>
            <option value="2">XBOX 360</option>
            <option value="1">PS3</option>
          </select>
          <a class="s_button_1 s_secondary_color_bgr"><span class="s_text">Go</span></a> 
        </div>
      </div>
      
      <div id="categories" class="s_nav">
        <ul>
          <li id="menu_home"> <a href="index.html">Inicio</a> </li>
          <li> <a href="listing_1.html">Juegos</a>
            <div class="s_submenu">
              <h3>Categorias</h3>
              <ul class="s_list_1 clearfix">
                <li> <a href="#">Accion</a>
                  
                </li>
                <li><a href="#">Peleas</a></li>
                <li><a href="#">Deporte</a></li>
              </ul>
              <span class="clear border_eee"></span>
              
        </ul>
      </div>
      
      <div id="cart_menu" class="s_nav">
      	<a href="/carrito"><span class="s_icon"></span> <small class="s_text">Carro</small><span class="s_grand_total s_main_color">
      	 $<?php
      	$t=0; 
      	$nitems=0;
      	$q=$this->usuario->getCarro()->getAllProductos();
      	foreach($q->result() as $row)
      	{
      		$t+=$row->Precio * $row->cantidad;
      		$nitems+=$row->cantidad;
      	}
      	
      	echo $t;
      	?></span></a>
        <div class="s_submenu s_cart_holder">
          <p class="s_mb_0"><?php echo $nitems?> Juegos</p>
        </div>
      </div>
      
    </div>
  </div>
  <!-- end of header --> 

  



  <!-- ********************** --> 

  <!--     I N T R O          -->

  <!-- ********************** --> 

  <div id="intro">

    <div id="intro_wrap">

      <div class="container_12">

        <div id="breadcrumbs" class="grid_12">

          <a href="/catalogo">Inicio</a>

           &gt; <a href="/carrito">Carro</a>

        </div>

        <h1>Carro de Compras</h1>

      </div>

    </div>

  </div>

  <!-- end of intro -->

  

  

  <!-- ********************** --> 

  <!--      C O N T E N T     --> 

  <!-- ********************** --> 

  <div id="content" class="container_12">

  

    <div id="shopping_cart" class="grid_12">
    <?php $current_url=base_url()."fincompra"?>
                      
     <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" accept-charset="utf-8">
   <input type="hidden" name="cmd" value="_xclick" />
                        <input type="hidden" name="charset" value="utf-8" />
                        <input type="hidden" name="business" value="sell_1340157886_biz@gmail.com" />
                        <input type="hidden" name="item_name" value="Guaripolo eCommerce" />
                        <input type="hidden" name="item_number" value="<?php echo 'store:'.$this->usuario->getCarro()->getIdCarro()?>"/>
                        <input type="hidden" name="amount" value="<?php echo $t/500?>" />
                        <input type="hidden" name="currency_code" value="USD" />
                        <input type="hidden" name="return" value=<?php echo $current_url;?> />
                        <input type="hidden" name="cancel_return" value=<?php echo $current_url;?> />
                        <input type="hidden" name="bn" value="Business_BuyNow_WPS_SE" />

        <table class="s_table_1" width="100%" cellpadding="0" cellspacing="0" border="0">

          <tr>
			
          <!--  <th width="65">Remover</th> -->

            <th  width="210">Imagen</th>

            <th width="280">Nombre</th>

            <th>Plataforma</th>

            <th>Cantidad</th>

            <th>Total</th>

          </tr>
			<?php 
            foreach($result->result() as $row)
            {?>
          <tr class="even">
			
           <!--  -<td valign="middle"><input type="checkbox" /></td> --->

            <td valign="middle" ><a href="/cproducto/listarproducto/<?php echo $row->idProductos?>"><img alt="Embedded Image" src="data:image/jpeg;base64,<?php echo base64_encode($row->Img);?>" width="200" height="100" alt="" /></a></td>

            <td valign="middle"><a href="/cproducto/listarproducto/<?php echo $row->idProductos?>"><strong>
            <?php	echo $row->Nombre;
            ?>
            <div class="fb-like" data-href="<?php echo base_url()?>cproducto/listarproducto/<?php echo $row->idProductos?>" data-send="false" data-layout="button_count" data-show-faces="false" data-width="130" data-height="20" data-color-scheme="light" data-locale="es_CL"></div>
       
            </strong></a></td>

            <td valign="middle"><?php echo $row->Plataforma;?></td>

            <td valign="middle"><?php echo $row->cantidad?></td>

            <td valign="middle"><?php echo $row->Precio;?><span class="s_currency s_after"> pesos</span></td>
		
          </tr>
			<?php }?>
          

          

        </table>

        <br />

        
        <p class="s_total s_secondary_color last"><strong>Total:</strong>
        $<?php
      	echo $t;
      	?><span class="s_currency s_after"></span></p>

                        

        <div class="clear"></div>

        <br />



        <a  href="/catalogo" class="s_button_1 s_ddd_bgr left"><span  class="s_text">Continuar comprando</span></a>

        <button class="s_button_1 s_main_color_bgr" type="submit"><span class="s_text">Checkout</span></button>
		</form>
		<FORM method="POST" action="/socialpay/buy" accept-charset="utf-8" >
		
		<input type="hidden" name="ids" value="<?php echo $ids;?>"/>
		<input type="hidden" name="precs" value="<?php echo $precs;?>"/>
		<input type="hidden" name="cants" value="<?php echo $cants;?>"/>
		
		<button class="s_button_1 s_main_color_bgr" type="submit"><span class="s_text">Social Pay</span></button>
		
        
       <!--   <a class="s_button_1 s_main_color_bgr"><span class="s_text">Actualizar Carro</span></a>-->

      </form>



    </div>



    <div class="clear"></div>

    <br />

    <br />

    

  </div>

  <!-- end of content --> 


  
  <!-- ********************** --> 
  <!--             I N F O    --> 
  <!-- ********************** --> 
  <div id="shop_info">
    <div id="shop_info_wrap">
      <div class="container_12">
        <div id="shop_description" class="grid_3">
          <h2>Guaripolo Store</h2>
          <p>Proyecto de Taller de sistemas de computacíon, tienda virtual.</p>
        </div>
        <div id="shop_contacts" class="grid_3">
          <h2>Contactanos</h2>
          <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td valign="middle"><span class="s_icon_32"><span class="s_icon s_phone_32"></span><br />12345</span></td>
            </tr>
            <tr>
              <td valign="middle"><span class="s_icon_32"><span class="s_icon s_mail_32"></span>contacto@guaripolostore.com <br /> </span></td>
            </tr>
            <tr>
              <td valign="middle"><span class="s_icon_32"><span class="s_icon s_skype_32"></span>guaripolo_store <br /> </span></td>
            </tr>
          </table>
        </div>
        <div id="twitter" class="grid_3">
          <h2>Twitter</h2>
          <ul id="twitter_update_list"><li></li></ul>
        </div>
        <div id="facebook" class="grid_3">
          <h2>Facebook</h2>
          <div class="s_widget_holder">
         
          </div>
        </div>
        <div class="clear"></div>
      </div>
    </div>
  </div>
  <!-- end of shop info --> 
  
  

    <div id="payments" class="right clearfix">
    
    </div>
    <p id="copy">&copy; 2012. Realizado por<a class="blue" href="">Equipo Guaripolo</a>.<br /> <a class="s_main_color" href="">Taller de Sistemas de Computación</a><a href=""></a></p>
  </div>
  <!-- end of FOOTER --> 
  
</div>

<div id="fb-root"></div>

</body>
</html>
  

